with Ada.Text_IO; use Ada.Text_IO;

package body export is
  procedure  Create(f : out file_type; path : in string) is
  begin
    Open(f, out_file, path);
  exception
    when others =>
      Create(f, out_file, path);
  end Create;

  procedure Add_Line(f : in file_type;
                     time : in string; kind : in string; content : in string) is
  begin
    Put(f, time&';'&kind&';'&'"');
    for i in content'range loop
      Put(f, content(i));
      if content(i) = '"' then Put(f, '"'); end if;
    end loop;
    Put(f, '"');
    new_line(f);
  end Add_Line;

  procedure Close(f : in out file_type) is
  begin
    Ada.Text_IO.Close(f);
  end Close;
end export;
